package com.zh.test.Thread;

import com.zh.test.controller.testController;
import com.zh.test.service.testServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Date;
import java.util.HashMap;
import java.util.Optional;

/**
 * @Author zh
 * @Description  测试项目自启动运行
 * @Date 2020/9/9 
 * @Param 
 * @return 
 **/
@Component
public class HandlerSelf implements ApplicationRunner {
    @Autowired
    public HandlerSelf2 handlerSelf2;
//    @Autowired
//    public testServiceImpl testService;
    public LocalDateTime now;
    @Override
    public void run(ApplicationArguments args) throws Exception {
//        now = LocalDateTime.now();
//        handlerSelf2.test();
//        handlerSelf2.setName("修改初始测试值");
//        handlerSelf2.test();
//        System.out.println("这是通过实现ApplicationRunner接口自执行");

       // testService.test1();
    }

    public static void main(String[] args) {
        HashMap<String ,String > m = new HashMap<>();
        m.put("token","xxx");
       // String token = Optional.of(m.get("zzz")).get();
        BigDecimal b = new BigDecimal("18.2");
        int i = b.multiply(new BigDecimal(10.00)).intValue();

    }
}
